package com.Poker.Group;

import com.Poker.Poker;

import java.util.Iterator;
import java.util.List;
import java.util.Map;

/**
 * Created by mike on 18/5/23.
 */
public class FourOfKindGroupFilter extends BaseGroupFilter {
    public FourOfKindGroupFilter(List<Poker> pokers) {
        super(pokers);
    }

    @Override
    protected boolean filterHandler() {
        Map<Integer, Integer> resultMap = this.groupNum(pokers);
        Iterator<Integer> numSet = resultMap.keySet().iterator();
        while(numSet.hasNext()){
            if(resultMap.get(numSet.next())==4){
                return true;
            }
        }
        return false;
    }
}
